<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>zyupload上传实例</title>
    <link rel="stylesheet" href="../../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../../lib/jq-module/zyupload/zyupload-1.0.0.min.css" media="all">
    <link rel="stylesheet" href="../../css/public.css" media="all">
</head>
<body>
<form action="/backend/menu/upload.do" enctype="multipart/form-data" method="post">
    <input type="file" name="multipartFile" onchange="showPreview(this)"><br/>
    <img width=100 height=100 id="itemPic"><br/>
    <button type="submit">提交</button>
</form>
</body>
<script type="text/javascript">
    function showPreview(source) {
        var file = source.files[0];
        if (window.FileReader) {
            var fr = new FileReader();
            fr.onloadend = function (e) {
                document.getElementById("itemPic").src = e.target.result;
            }
            fr.readAsDataURL(file);
        }
    }
</script>
</html>